function y = fun(x,label)
%Function is used to calculate the particle fitness value
%x           input           
%y           output          
if label==1
    %y=-Rastrigin(x);
    y=Sphere1(x);
elseif label==2
    y=Rosenbrock2(x);
elseif label==3
    y=Step3(x);
elseif label==4
    y=Schwefel4(x);
elseif label==5
    y=Rastrigin5(x);
elseif label==6
    y=Ackley6(x);
elseif label==7
    y=Griewank7(x);
elseif label==8
    y=Sin8(x);
else 
    y=Cos9(x);
    
end